import { LoaderManager } from "../../../../../com/gengine/resource/LoaderManager";
import { ResouceConst } from "../../../../component/gconst/ResouceConst";
import { ImagesConst } from "../../../resource/ImagesConst";
import { RewardList2 } from "../../dialog/player/RewardList2";
import { GScrollPane } from "../../../../../com/mui/controls/GScrollPane";
import { ScrollPolicy } from "../../../../../fl/controls/ScrollPolicy";
import { SWFInfo } from "../../../../../com/gengine/resource/info/SWFInfo";
import { ChristmasActivitiesInfo } from "../../../model/ChristmasActivitiesInfo";
import { ScaleBitmap } from "../../../../../com/mui/display/ScaleBitmap";
type int = number;
//class ChristmasRewardPanel
    
    export  class ChristmasRewardPanel /* flash.display.Sprite */
    {
        constructor(arg1: int, arg2: int)
        {
            
            this._width = arg1;
            this._height = arg2;
            this.initUI();
            return;
        }

        /* internal  */initUI(): void
        {
            LoaderManager.instance.load("ChristmasActiveRewardImg.swf", this.onDesImgLoaded);
            this._bg = ResouceConst.getScaleBitmap(ImagesConst.WindowCenterB);
            this._bg.width = this._width;
            this._bg.height = this._height - 25;
            this._bg.x = 0;
            this._bg.y = 25;
            addChild(this._bg);
            this._rewardList = new RewardList2(this.width - 10);
            this._rewardList.horGap = 0;
            this._scrollPane = new GScrollPane();
            this._scrollPane.x = this._bg.x + 2;
            this._scrollPane.y = this._bg.y + 2;
            this._scrollPane.width = this.width - 4;
            this._scrollPane.height = this._bg.height - 4;
            this._scrollPane.styleName = "GScrollPane";
            this._scrollPane.verticalScrollPolicy = ScrollPolicy.AUTO;
            this._scrollPane.horizontalScrollPolicy = ScrollPolicy.OFF;
            this._scrollPane.source = this._rewardList;
            this._scrollPane.scrollDrag = false;
            this._scrollPane.focusEnabled = false;
            addChild(this._scrollPane);
            return;
        }

        /* internal  */onDesImgLoaded(arg1: SWFInfo): void
        {
            if (arg1 && arg1.clip) 
            {
                arg1.clip.x = (this.width - arg1.clip.width) / 2;
                addChild(arg1.clip);
            }
            return;
        }

        public updateData(arg1: ChristmasActivitiesInfo): void
        {
            this._rewardList.updateData(arg1.rewardsFormat);
            this._scrollPane.refreshPane();
            this._scrollPane.update();
            return;
        }

        public dispose(): void
        {
            this._rewardList.dispose();
            this._info = null;
            return;
        }

        public /* override */ get width(): number
        {
            return this._width;
        }

        public /* override */ get height(): number
        {
            return this._height;
        }

        /* internal */ /* var */_width: int;

        /* internal */ /* var */_height: int;

        /* internal */ /* var */_info: ChristmasActivitiesInfo;

        /* internal */ /* var */_bg: ScaleBitmap;

        /* internal */ /* var */_rewardList: RewardList2;

        /* internal */ /* var */_scrollPane: GScrollPane;
    }
